package acm.test;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;


public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double target = sc.nextDouble();
        double c = sc.nextDouble();
        double k = sc.nextDouble();
        double startPrice = sc.nextDouble();
        int n = sc.nextInt();
        double[][] gasStation = new double[n + 1][2];
        gasStation[0][1] = startPrice;
        for (int i = 1; i < gasStation.length; i++) {
            gasStation[i][0] = sc.nextDouble();
            gasStation[i][1] = sc.nextDouble();
        }
        double v = fun1(target, c, k, gasStation);
        System.out.println(String.format("%.2f", v));
    }

    /**
     * T5221：指定你到目的地的距离target
     * 以及你油箱的容量c，每升油能走的距离k
     * 现有n+1个加油站（多出来的那个是在起点位置）
     * 每个加油站距起点的位置为 gasStation[i][0]，加油站每升油对应的价格为gasStation[i][1]。
     * 求你到达目的地所需的最少油费
     * 思路：
     * 将所有的加油站以距离为比较对象放入一个小根堆distanceQueue中。
     * 将解锁的油站以价格为比较对象放入小根堆priceQueue中。
     * 1.以满油情况下将距离堆中能解锁的油站放入 价格堆 中。（需要在目的地之内）
     * 2.用当前油站与价格堆顶油站的价格对比。(如果价格堆中为空，则表示不可抵达下一个油站)
     * 如果当前油价低于堆顶油价：则在当前油站加满(或加到刚好抵达目的地)
     * 如果当前油价高于堆顶油价：则在当前油站加到刚好能开到堆顶油站的价格
     * 3.开到堆顶油站后，将小于当前距离的油站从价格堆中移除。再重复1，2
     */
    public static double fun1(double target, double c, double k, double[][] gasStation) {
        Comparator<double[]> comparator1 = new Comparator<double[]>() {
            @Override
            public int compare(double[] a, double[] b) {
                if (a[0] == b[0]) {
                    return 0;
                }
                return (a[0] - b[0]) < 0 ? -1 : 1;
            }
        };
        Comparator<double[]> comparator2 = new Comparator<double[]>() {
            @Override
            public int compare(double[] a, double[] b) {
                if (a[1] == b[1]) {
                    return 0;
                }
                return (a[1] - b[1]) < 0 ? -1 : 1;
            }
        };
        PriorityQueue distanceQueue = new PriorityQueue(comparator1, gasStation.length+1);
        PriorityQueue priceQueue = new PriorityQueue(comparator2, gasStation.length+1);
        for (int i = 1; i < gasStation.length; i++) {
            distanceQueue.add(gasStation[i]);
        }
        double resMoney = 0;      //最后的金额
        double[] curStation = gasStation[0];    //当前油站
        double currDistance=0;
        double restGas = 0;   //剩余油量

        do {
            while (!distanceQueue.isEmpty() && curStation[0] + c * k >= distanceQueue.peek()[0]) {
                if (distanceQueue.peek()[0] <= target) {
                    priceQueue.add(distanceQueue.poll());   //解锁到价格堆中
                }
            }
            double[] next =priceQueue.poll();  //没有油站了
            double needGas = 0;  //需要在当前节点加多少油
            if (curStation[0] + c * k >= target) {    //当前油站能抵达终点
                //当前油站能抵达终点，判断是在该油站加到终点还是在下一个
                needGas = curStation[1] <= next[1] ? (target - curStation[0]) / k - restGas : (next[0] - curStation[0]) / k - restGas;
            } else {
                //当前油站不能抵达终点，判断是在该油站加满还是在下一个
                needGas = curStation[1] <= next[1] ? c - restGas : (next[0] - curStation[0]) / k - restGas;
            }
            resMoney += curStation[1] * needGas;
            restGas = restGas + needGas - next[0] / k;  //加油到移动到下一个节点的量
            curStation = restGas*k>=target?curStation:next; //直接抵达终点或到下一个油站
            currDistance=curStation[0]+restGas*k;
            while (!priceQueue.isEmpty()&&priceQueue.peek()[0]<curStation[0]){
                priceQueue.poll();
            }
        } while (!priceQueue.isEmpty());

        if (curStation[0]+c*k<target){
            return -1;
        }else if(currDistance<target){
            double needGas=(target-curStation[0])/k;
            resMoney+=needGas*curStation[1];
        }
        return resMoney;
    }

    private static class PriorityQueue {
        Comparator<double[]> comparator;
        double[][] data;
        public int size;


        public boolean isEmpty() {
            return size <= 0;
        }

        public double[] peek() {
            return data[0];
        }

        public PriorityQueue(Comparator<double[]> comparator,int capacity) {
            this.comparator = comparator;
            data = new double[capacity][2];
            for (int i = 0; i < data.length; i++) {
                Arrays.fill(data[i],Double.MAX_VALUE);
            }
        }

        public void add(double[] doubles) {
            int i = size;
            data[size++] = doubles;
            while (less(data[i], data[(i - 1) / 2])) {
                replace(i, (i - 1) / 2);
                i = (i - 1) / 2;
            }
        }

        private boolean less(double[] a, double[] b) {
            return this.comparator.compare(a, b) < 0;
        }

        public double[] poll() {
            if (isEmpty()){
                return null;
            }
            double[] poll = data[0];
            replace(0, --size);
            int index = 0;
            int left = index * 2 + 1;
            while (left < size) {
                int minIndex = left + 1 < size && less(data[left + 1], data[left]) ? left + 1 : left;
                int target = less(data[minIndex], data[index]) ? minIndex : index;
                if (target==index){
                    return poll;
                }
                replace(index,target);
                index=target;
                left=index*2+1;
            }
            return poll;
        }

        public void replace(int a, int b) {
            double[] temp = data[a];
            data[a] = data[b];
            data[b] = temp;
        }
    }
}
